package com.shenda.device.message;

import com.shenda.device.enums.Cmd;
import com.swak.rxtx.codec.Encodes;

import lombok.Data;
import lombok.Getter;
import lombok.Setter;
import lombok.experimental.Accessors;

/**
 * 基础消息
 * 
 * @author lifeng
 */
@Data
@Getter
@Setter
@Accessors(chain = true)
public class BaseMsg implements Encodes {

	protected String head;
	protected Cmd cmd;
	protected String content;
	protected String end;

	/**
	 * 返回当前类型
	 * 
	 * @param <T>
	 * @return
	 */
	@SuppressWarnings("unchecked")
	public <T> T as() {
		return (T) this;
	}
}